Optimal. Leaf size=301 \[ \frac{2 B n \text{PolyLog}\left (2,\frac{(a+b x) (d g-c h)}{(c+d x) (b g-a h)}\right ) \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )}{h}-\frac{2 B n \text{PolyLog}\left (2,\frac{d (a+b x)}{b (c+d x)}\right ) \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )}{h}-\frac{2 B^2 n^2 \text{PolyLog}\left (3,\frac{(a+b x) (d g-c h)}{(c+d x) (b g-a h)}\right )}{h}+\frac{2 B^2 n^2 \text{PolyLog}\left (3,\frac{d (a+b x)}{b (c+d x)}\right )}{h}+\frac{\log \left (1-\frac{(a+b x) (d g-c h)}{(c+d x) (b g-a h)}\right ) \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )^2}{h}-\frac{\log \left (\frac{b c-a d}{b (c+d x)}\right ) \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )^2}{h} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.815256, antiderivative size = 473, normalized size of antiderivative = 1.57, number of steps used = 16, number of rules used = 10, integrand size = 33, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.303, Rules used = {6742, 2494, 2394, 2393, 2391, 2489, 2488, 2506, 6610, 2503} \[ -\frac{2 A B n \text{PolyLog}\left (2,\frac{b (g+h x)}{b g-a h}\right )}{h}+\frac{2 B^2 n \log \left (e (a+b x)^n (c+d x)^{-n}\right ) \text{PolyLog}\left (2,1-\frac{(g+h x) (b c-a d)}{(c+d x) (b g-a h)}\right )}{h}-\frac{2 B^2 n \text{PolyLog}\left (2,1-\frac{b c-a d}{b (c+d x)}\right ) \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{h}-\frac{2 B^2 n^2 \text{PolyLog}\left (3,1-\frac{(g+h x) (b c-a d)}{(c+d x) (b g-a h)}\right )}{h}+\frac{2 B^2 n^2 \text{PolyLog}\left (3,1-\frac{b c-a d}{b (c+d x)}\right )}{h}+\frac{2 A B n \text{PolyLog}\left (2,\frac{d (g+h x)}{d g-c h}\right )}{h}+\frac{2 A B \log (g+h x) \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{h}-\frac{2 A B n \log (g+h x) \log \left (-\frac{h (a+b x)}{b g-a h}\right )}{h}+\frac{B^2 \log ^2\left (e (a+b x)^n (c+d x)^{-n}\right ) \log \left (\frac{(g+h x) (b c-a d)}{(c+d x) (b g-a h)}\right )}{h}-\frac{B^2 \log \left (\frac{b c-a d}{b (c+d x)}\right ) \log ^2\left (e (a+b x)^n (c+d x)^{-n}\right )}{h}+\frac{A^2 \log (g+h x)}{h}+\frac{2 A B n \log (g+h x) \log \left (-\frac{h (c+d x)}{d g-c h}\right )}{h} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 6742
Rule 2494
Rule 2394
Rule 2393
Rule 2391
Rule 2489
Rule 2488
Rule 2506
Rule 6610
Rule 2503
Rubi steps
\begin{align*} \int \frac{\left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )^2}{g+h x} \, dx &=\int \left (\frac{A^2}{g+h x}+\frac{2 A B \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{g+h x}+\frac{B^2 \log ^2\left (e (a+b x)^n (c+d x)^{-n}\right )}{g+h x}\right ) \, dx\\ &=\frac{A^2 \log (g+h x)}{h}+(2 A B) \int \frac{\log \left (e (a+b x)^n (c+d x)^{-n}\right )}{g+h x} \, dx+B^2 \int \frac{\log ^2\left (e (a+b x)^n (c+d x)^{-n}\right )}{g+h x} \, dx\\ &=\frac{A^2 \log (g+h x)}{h}+\frac{2 A B \log \left (e (a+b x)^n (c+d x)^{-n}\right ) \log (g+h x)}{h}+\frac{\left (B^2 d\right ) \int \frac{\log ^2\left (e (a+b x)^n (c+d x)^{-n}\right )}{c+d x} \, dx}{h}-\frac{\left (B^2 (d g-c h)\right ) \int \frac{\log ^2\left (e (a+b x)^n (c+d x)^{-n}\right )}{(c+d x) (g+h x)} \, dx}{h}-\frac{(2 A b B n) \int \frac{\log (g+h x)}{a+b x} \, dx}{h}+\frac{(2 A B d n) \int \frac{\log (g+h x)}{c+d x} \, dx}{h}\\ &=-\frac{B^2 \log \left (\frac{b c-a d}{b (c+d x)}\right ) \log ^2\left (e (a+b x)^n (c+d x)^{-n}\right )}{h}+\frac{A^2 \log (g+h x)}{h}-\frac{2 A B n \log \left (-\frac{h (a+b x)}{b g-a h}\right ) \log (g+h x)}{h}+\frac{2 A B n \log \left (-\frac{h (c+d x)}{d g-c h}\right ) \log (g+h x)}{h}+\frac{2 A B \log \left (e (a+b x)^n (c+d x)^{-n}\right ) \log (g+h x)}{h}+\frac{B^2 \log ^2\left (e (a+b x)^n (c+d x)^{-n}\right ) \log \left (\frac{(b c-a d) (g+h x)}{(b g-a h) (c+d x)}\right )}{h}+(2 A B n) \int \frac{\log \left (\frac{h (a+b x)}{-b g+a h}\right )}{g+h x} \, dx-(2 A B n) \int \frac{\log \left (\frac{h (c+d x)}{-d g+c h}\right )}{g+h x} \, dx+\frac{\left (2 B^2 (b c-a d) n\right ) \int \frac{\log \left (-\frac{-b c+a d}{b (c+d x)}\right ) \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{(a+b x) (c+d x)} \, dx}{h}-\frac{\left (2 B^2 (b c-a d) n\right ) \int \frac{\log \left (e (a+b x)^n (c+d x)^{-n}\right ) \log \left (-\frac{(-b c+a d) (g+h x)}{(b g-a h) (c+d x)}\right )}{(a+b x) (c+d x)} \, dx}{h}\\ &=-\frac{B^2 \log \left (\frac{b c-a d}{b (c+d x)}\right ) \log ^2\left (e (a+b x)^n (c+d x)^{-n}\right )}{h}+\frac{A^2 \log (g+h x)}{h}-\frac{2 A B n \log \left (-\frac{h (a+b x)}{b g-a h}\right ) \log (g+h x)}{h}+\frac{2 A B n \log \left (-\frac{h (c+d x)}{d g-c h}\right ) \log (g+h x)}{h}+\frac{2 A B \log \left (e (a+b x)^n (c+d x)^{-n}\right ) \log (g+h x)}{h}+\frac{B^2 \log ^2\left (e (a+b x)^n (c+d x)^{-n}\right ) \log \left (\frac{(b c-a d) (g+h x)}{(b g-a h) (c+d x)}\right )}{h}-\frac{2 B^2 n \log \left (e (a+b x)^n (c+d x)^{-n}\right ) \text{Li}_2\left (1-\frac{b c-a d}{b (c+d x)}\right )}{h}+\frac{2 B^2 n \log \left (e (a+b x)^n (c+d x)^{-n}\right ) \text{Li}_2\left (1-\frac{(b c-a d) (g+h x)}{(b g-a h) (c+d x)}\right )}{h}+\frac{(2 A B n) \operatorname{Subst}\left (\int \frac{\log \left (1+\frac{b x}{-b g+a h}\right )}{x} \, dx,x,g+h x\right )}{h}-\frac{(2 A B n) \operatorname{Subst}\left (\int \frac{\log \left (1+\frac{d x}{-d g+c h}\right )}{x} \, dx,x,g+h x\right )}{h}+\frac{\left (2 B^2 (b c-a d) n^2\right ) \int \frac{\text{Li}_2\left (1+\frac{-b c+a d}{b (c+d x)}\right )}{(a+b x) (c+d x)} \, dx}{h}-\frac{\left (2 B^2 (b c-a d) n^2\right ) \int \frac{\text{Li}_2\left (1+\frac{(-b c+a d) (g+h x)}{(b g-a h) (c+d x)}\right )}{(a+b x) (c+d x)} \, dx}{h}\\ &=-\frac{B^2 \log \left (\frac{b c-a d}{b (c+d x)}\right ) \log ^2\left (e (a+b x)^n (c+d x)^{-n}\right )}{h}+\frac{A^2 \log (g+h x)}{h}-\frac{2 A B n \log \left (-\frac{h (a+b x)}{b g-a h}\right ) \log (g+h x)}{h}+\frac{2 A B n \log \left (-\frac{h (c+d x)}{d g-c h}\right ) \log (g+h x)}{h}+\frac{2 A B \log \left (e (a+b x)^n (c+d x)^{-n}\right ) \log (g+h x)}{h}+\frac{B^2 \log ^2\left (e (a+b x)^n (c+d x)^{-n}\right ) \log \left (\frac{(b c-a d) (g+h x)}{(b g-a h) (c+d x)}\right )}{h}-\frac{2 A B n \text{Li}_2\left (\frac{b (g+h x)}{b g-a h}\right )}{h}+\frac{2 A B n \text{Li}_2\left (\frac{d (g+h x)}{d g-c h}\right )}{h}-\frac{2 B^2 n \log \left (e (a+b x)^n (c+d x)^{-n}\right ) \text{Li}_2\left (1-\frac{b c-a d}{b (c+d x)}\right )}{h}+\frac{2 B^2 n \log \left (e (a+b x)^n (c+d x)^{-n}\right ) \text{Li}_2\left (1-\frac{(b c-a d) (g+h x)}{(b g-a h) (c+d x)}\right )}{h}+\frac{2 B^2 n^2 \text{Li}_3\left (1-\frac{b c-a d}{b (c+d x)}\right )}{h}-\frac{2 B^2 n^2 \text{Li}_3\left (1-\frac{(b c-a d) (g+h x)}{(b g-a h) (c+d x)}\right )}{h}\\ \end{align*}
Mathematica [B] time = 0.462649, size = 1082, normalized size = 3.59 \[ \frac{-2 n \left (-n \log (a+b x)+n \log (c+d x)+\log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \left (\log (c+d x) \log \left (\frac{d (g+h x)}{d g-c h}\right )+\text{PolyLog}\left (2,\frac{h (c+d x)}{c h-d g}\right )\right ) B^2+n^2 \left (\log \left (\frac{b (g+h x)}{b g-a h}\right ) \log ^2(a+b x)+2 \text{PolyLog}\left (2,\frac{h (a+b x)}{a h-b g}\right ) \log (a+b x)-2 \text{PolyLog}\left (3,\frac{h (a+b x)}{a h-b g}\right )\right ) B^2+n^2 \left (\log \left (\frac{d (g+h x)}{d g-c h}\right ) \log ^2(c+d x)+2 \text{PolyLog}\left (2,\frac{h (c+d x)}{c h-d g}\right ) \log (c+d x)-2 \text{PolyLog}\left (3,\frac{h (c+d x)}{c h-d g}\right )\right ) B^2-2 n^2 \left (\frac{1}{2} \left (\log \left (\frac{a d-b c}{d (a+b x)}\right )+\log \left (\frac{b (g+h x)}{b g-a h}\right )-\log \left (\frac{(a d-b c) (g+h x)}{(d g-c h) (a+b x)}\right )\right ) \log ^2\left (\frac{(b g-a h) (c+d x)}{(d g-c h) (a+b x)}\right )+\log \left (\frac{h (c+d x)}{c h-d g}\right ) \left (\log \left (\frac{d (g+h x)}{d g-c h}\right )-\log \left (\frac{b (g+h x)}{b g-a h}\right )\right ) \log \left (\frac{(b g-a h) (c+d x)}{(d g-c h) (a+b x)}\right )+\left (\text{PolyLog}\left (2,\frac{b (c+d x)}{d (a+b x)}\right )-\text{PolyLog}\left (2,\frac{(b g-a h) (c+d x)}{(d g-c h) (a+b x)}\right )\right ) \log \left (\frac{(b g-a h) (c+d x)}{(d g-c h) (a+b x)}\right )+\log (a+b x) \log (c+d x) \log \left (\frac{b (g+h x)}{b g-a h}\right )+\frac{1}{2} \log \left (\frac{h (c+d x)}{c h-d g}\right ) \left (\log \left (\frac{h (c+d x)}{c h-d g}\right )-2 \log (a+b x)\right ) \left (\log \left (\frac{b (g+h x)}{b g-a h}\right )-\log \left (\frac{d (g+h x)}{d g-c h}\right )\right )+\left (\log (c+d x)-\log \left (\frac{(b g-a h) (c+d x)}{(d g-c h) (a+b x)}\right )\right ) \text{PolyLog}\left (2,\frac{h (a+b x)}{a h-b g}\right )+\left (\log (a+b x)+\log \left (\frac{(b g-a h) (c+d x)}{(d g-c h) (a+b x)}\right )\right ) \text{PolyLog}\left (2,\frac{h (c+d x)}{c h-d g}\right )-\text{PolyLog}\left (3,\frac{h (a+b x)}{a h-b g}\right )-\text{PolyLog}\left (3,\frac{h (c+d x)}{c h-d g}\right )-\text{PolyLog}\left (3,\frac{b (c+d x)}{d (a+b x)}\right )+\text{PolyLog}\left (3,\frac{(b g-a h) (c+d x)}{(d g-c h) (a+b x)}\right )\right ) B^2+2 n \left (A+B \left (-n \log (a+b x)+n \log (c+d x)+\log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )\right ) \left (\log (a+b x) \log \left (\frac{b (g+h x)}{b g-a h}\right )+\text{PolyLog}\left (2,\frac{h (a+b x)}{a h-b g}\right )\right ) B-2 A n \left (\log (c+d x) \log \left (\frac{d (g+h x)}{d g-c h}\right )+\text{PolyLog}\left (2,\frac{h (c+d x)}{c h-d g}\right )\right ) B+\left (A+B \left (-n \log (a+b x)+n \log (c+d x)+\log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )\right )^2 \log (g+h x)}{h} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F] time = 2.559, size = 0, normalized size = 0. \begin{align*} \int{\frac{1}{hx+g} \left ( A+B\ln \left ({\frac{e \left ( bx+a \right ) ^{n}}{ \left ( dx+c \right ) ^{n}}} \right ) \right ) ^{2}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F] time = 0., size = 0, normalized size = 0. \begin{align*} \frac{A^{2} \log \left (h x + g\right )}{h} + \int \frac{B^{2} \log \left ({\left (b x + a\right )}^{n}\right )^{2} + B^{2} \log \left ({\left (d x + c\right )}^{n}\right )^{2} + B^{2} \log \left (e\right )^{2} + 2 \, A B \log \left (e\right ) + 2 \,{\left (B^{2} \log \left (e\right ) + A B\right )} \log \left ({\left (b x + a\right )}^{n}\right ) - 2 \,{\left (B^{2} \log \left ({\left (b x + a\right )}^{n}\right ) + B^{2} \log \left (e\right ) + A B\right )} \log \left ({\left (d x + c\right )}^{n}\right )}{h x + g}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F] time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (\frac{B^{2} \log \left (\frac{{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right )^{2} + 2 \, A B \log \left (\frac{{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + A^{2}}{h x + g}, x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{{\left (B \log \left (\frac{{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + A\right )}^{2}}{h x + g}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]